﻿@using FCZLM.Core.Models
@using Microsoft.AspNetCore.Http
@model Users
@{
    var orders = ViewBag.Orders as List<Orders>;
    var orderdetails = ViewBag.OrderDetails as List<OrderDetails>;
    var product = ViewBag.Product as List<Products>;
    var producturl = ViewBag.ProductUrl;
}
<div class="pnt">
   <div class="pntLeft">
    <h2 class="Title">用户中心
     <ul class="InPorNav">
    
    </ul><!--InPorNav/-->
    </h2>
   </div><!--pntLeft/-->
   <div class="pntRight">
    <ul class="nav">
     <li><a href="/home/index">商城首页</a></li>
     <li><a href="/product/index">商品中心</a></li>
   
     <li><a href="/news/index">新闻中心</a></li>
          <li>  @if(@Context.Session.GetString(key:"user")==null){
							 <a href="/login/index">用户中心</a>
						}else{
							
							 <a href="/user/index">用户中心</a>
							
						}     </li>
     <li><a href="/contact/index">联系我们</a></li>
     <div class="clears"></div>
     <div class="phone">TEL：021-12345678</div>
    </ul><!--nav/-->
   </div><!--pntRight/-->
   <div class="clears"></div>
  </div><!--pnt/-->
 <div class="contLeft" id="contLeft">
    <h3 class="leftTitle">用户中心</h3>
    <dl class="helpNav vipNav">
     <dt>我的主页</dt>
      <dd>
       <a href="/user/index" class="vipCur">个人中心</a>
       <a href="/order/index">我的订单</a>
       <a href="/shoppingcart/index">我的购物车</a>
      </dd>
       <dt>客户服务</dt>
     <dd>
      <a href="/message/index">在线留言</a>
       
       
      </dd>
      
      
    </dl><!--helpNav/-->
   </div><!--contLeft/-->
   <div class="contRight">
    <h1 class="vipName"><span>用户名：</span>@Model.UserName</h1>
    <h2 class="oredrName">
   我的订单
    </h2>
    <div>
      <span><a href="/order/index">全部订单丨</a></span>
      <span><a href="/order/index2/1">未付款丨</a></span>
      <span><a href="/order/index3/0">待发货丨</a></span>
      <span><a href="/order/index4/2">已发货</a></span>
       
       
    </div>
    <table class="vipOrder" >
     @foreach(var ordersitem in orders)
            {
            if (orders == null)
            {
                <tr><td><a href="/product/index">您还没有订单哦，快去商城看看吧！</a></td></tr>
            }
            else
            {
                 @foreach (var productitem in product)
                {
                    
                     <tr>
                      <td><img src="@producturl.PicUrl" width="60" height="55"></td>
                      <td>@Model.UserName</td>
                      <td>￥@ordersitem.TotalMoney
                      <td>@ordersitem.CreateTime</td>
                        <td><span>@if (ordersitem.Status == 0)
                                {
                                    <span>未付款</span>
                                } else if (ordersitem.Status == 1)
                                {
                                     <span>待发货</span>
                                }else if (ordersitem.Status == 2)
                                {
                                      <span>已发货</span>
                                }
                            </span></td>
                        <td><a href="/orderDetails/index">查看详情</a></td>
                  </tr>
                }    
            }
        }
           
    </table><!--vipOrder/-->
   
   </div><!--contRight/-->
   <div class="clears"></div>
 